package com.dsprun.dspai.controller;


import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Tag(name = "HomeController", description = "首页")
@Controller
public class HomeController {

    @GetMapping("/")
    @Operation(summary  = "默认页面显示欢迎首页")
    public String home() {
        return "index"; // 对应 templates/index.html
    }

    @GetMapping("/api/public/index")
    @Operation(summary = "测试页面,测试ResponseBody")
    @ResponseBody // 直接返回字符串内容，不解析为模板
    public String test() {
        return "这是一个测试页面";
    }

}